package com.imut.lagain.entity;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;

import java.time.LocalDateTime;

/**
 * 记忆胶囊实体类
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("memory_capsule")
public class MemoryCapsule {
    private static final Logger log = LoggerFactory.getLogger(MemoryCapsule.class);

    
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    
    /**
     * 创建者用户ID
     */
    @NotNull(message = "用户ID不能为空")
    @TableField("user_id")
    private Long userId;
    
    /**
     * 胶囊标题
     */
    @NotBlank(message = "胶囊标题不能为空")
    @Size(max = 200, message = "胶囊标题长度不能超过200个字符")
    @TableField("title")
    private String title;
    
    /**
     * 胶囊描述
     */
    @Size(max = 1000, message = "胶囊描述长度不能超过1000个字符")
    @TableField("description")
    private String description;
    
    /**
     * 胶囊类型（1-个人，2-共享）
     */
    @TableField("type")
    private Integer type = 1;
    
    /**
     * 封面图片URL
     */
    @Size(max = 500, message = "封面图片URL长度不能超过500个字符")
    @TableField("cover_image_url")
    private String coverImageUrl;
    
    /**
     * 胶囊状态（1-创建中，2-已封存，3-已开启）
     */
    @TableField("status")
    private Integer status = 1;
    
    /**
     * 开启时间
     */
    @TableField("open_time")
    private LocalDateTime openTime;
    
    /**
     * 封存时间
     */
    @TableField("sealed_time")
    private LocalDateTime sealedTime;
    
    /**
     * 实际开启时间
     */
    @TableField("actual_open_time")
    private LocalDateTime actualOpenTime;
    
    /**
     * 最后活跃时间
     */
    @TableField("last_active_time")
    private LocalDateTime lastActiveTime;
    
    /**
     * 分享码
     */
    @Size(max = 50, message = "分享码长度不能超过50个字符")
    @TableField("share_code")
    private String shareCode;
    
    /**
     * 访问密码
     */
    @Size(max = 100, message = "访问密码长度不能超过100个字符")
    @TableField("access_password")
    private String accessPassword;
    
    /**
     * 创建时间
     */
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;
    
    /**
     * 更新时间
     */
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;
    
    /**
     * 是否删除(1-已删除, 0-未删除)
     */
    @TableLogic
    @TableField("is_deleted")
    private Boolean isDeleted = false;
    
    /**
     * 删除时间
     */
    @TableField("delete_time")
    private LocalDateTime deleteTime;
    public String getAccessPassword() {
        return accessPassword;
    }
    
    public void setAccessPassword(String accessPassword) {
        this.accessPassword = accessPassword;
    }
    
    public Long getId() {
        return id;
    }
    
    public void setId(Long id) {
        this.id = id;
    }
    
    public LocalDateTime getOpenTime() {
        return openTime;
    }
    
    public void setOpenTime(LocalDateTime openTime) {
        this.openTime = openTime;
    }
    
    public String getTitle() {
        return title;
    }
    
    public void setTitle(String title) {
        this.title = title;
    }
    
    public Boolean getIsDeleted() {
        return isDeleted;
    }
    
    public void setIsDeleted(Boolean isDeleted) {
        this.isDeleted = isDeleted;
    }
    
    public LocalDateTime getDeleteTime() {
        return deleteTime;
    }
    
    public void setDeleteTime(LocalDateTime deleteTime) {
        this.deleteTime = deleteTime;
    }
    
    public Long getUserId() {
        return userId;
    }
    
    public void setUserId(Long userId) {
        this.userId = userId;
    }
    
    public String getDescription() {
        return description;
    }
    
    public void setDescription(String description) {
        this.description = description;
    }
    
    public String getCoverImageUrl() {
        return coverImageUrl;
    }
    
    public void setCoverImageUrl(String coverImageUrl) {
        this.coverImageUrl = coverImageUrl;
    }
    
    public Integer getType() {
        return type;
    }
    
    public void setType(Integer type) {
        this.type = type;
    }
    
    public Integer getStatus() {
        return status;
    }
    
    public void setStatus(Integer status) {
        this.status = status;
    }
    
    public String getShareCode() {
        return shareCode;
    }
    
    public void setShareCode(String shareCode) {
        this.shareCode = shareCode;
    }
    
    public LocalDateTime getLastActiveTime() {
        return lastActiveTime;
    }
    
    public void setLastActiveTime(LocalDateTime lastActiveTime) {
        this.lastActiveTime = lastActiveTime;
    }
    
    public LocalDateTime getCreateTime() {
        return createTime;
    }
    
    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }
    
    public LocalDateTime getUpdateTime() {
        return updateTime;
    }
    
    public void setUpdateTime(LocalDateTime updateTime) {
        this.updateTime = updateTime;
    }
    
    public void setActualOpenTime(LocalDateTime actualOpenTime) {
        this.actualOpenTime = actualOpenTime;
    }
    
    public LocalDateTime getActualOpenTime() {
        return actualOpenTime;
    }
}
